<%@page import="java.sql.ResultSet"%>
<%@page import="database.DBConnector"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="javax.swing.text.Document"%>
<html>
    <head>
        <script type="text/javascript" src="search_ajax.js"> </script>
        <link rel="stylesheet" type="text/css" href="../CSS/frontend.css"/>
        <title>Firstmile - Reservedele til din klasikker</title>
    </head>
    <body>
        <div id="main">
            <jsp:include page="topBar.jsp"></jsp:include>
            <div id="content">
                <form action="search.jsp" name="search_form" method="POST">
                    <table align="center">
                        <td width="80px">Mærke:</td>
                        <td><select name="make" onchange="changeModel(this.value);">
                                <%
                                            DBConnector dbc = DBConnector.getDBC();
                                            ResultSet rs = dbc.doQuery("SELECT DISTINCT MakeID FROM Cars;");
                                            while (rs.next()) {
                                                out.println("<option>" + rs.getString(1) + "</option>");
                                            }
                                %>
                            </select></td>
                        <tr><td>Model:</td>
                            <td>
                                <select name="model" id="model">
                                    <option>Vælg model</option>
                                </select>

                            </td></tr>
                        <tr><td>År:</td>
                            <td> <input type="text" name="year" value="" maxlength="4" size="7px" ></td></tr>
                        <tr><td><input type="submit" name="search" value="Søg"></td></tr>
                    </table>
                </form>
            </div>
            <jsp:include page="footNote.jsp"></jsp:include>
        </div>
    </body>
</html>
